<?php
include ("include.php");
$title = $arr_viewcart_tile[$langid];

$shoppingcart = new class_shoppingcart();
$langid = $_GET["langid"];
$catid = $_GET["catid"];
$subcatid = $_GET["subcatid"];
if($subcatid > 0){
	$id = $subcatid;
}else{
	$id = $catid;
}

if ($langid == ""){
	$langid = 0;
}

//Layout
$layout_file = $arr_layout[$langid][0];
include("html_layout.php");


$str_content = $shoppingcart->viewcart();
$str_htm = ereg_replace("@noidung@", "$str_content", $str_htm);

//Header Loading - CSS, Meta, Javascript ...
include("html_header.php");

//Body Loading - Date-Time, ...
include("html_body.php");	

//Menu include
include("html_menu.php");

//Modules include
include("modules.php");

//============ Sajax
function soluong($x, $id) {
	global $session_arr_cart;
	$arr_cart = $session_arr_cart;
	$arr_cart[$id] = $x;
	
	session_unregister('session_arr_cart');
	$session_arr_cart = $arr_cart;
	session_register('session_arr_cart');		
}

sajax_init();
//$sajax_debug_mode = 1;
//sajax_export("tieubieu","spmoi");
sajax_export("soluong");
sajax_handle_client_request();
// end sajax =======================


$sajax_js = sajax_get_javascript();
$str_htm = ereg_replace("@sajax_js@", "$sajax_js", $str_htm);


print $str_htm;
?>